<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../css/comnon.css">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/login.css">
</head>
<body>
    <div class="loginTop">
        <div class="container">
            <a href="">
                <img src="../images/logo.png" alt="">
            </a>
        </div>
    </div>
    <div class="loginBanner">
        <div class="container">
            <div class="loginAccount">
                <form action="https://www.baidu.com/s?wd=%E4%B8%96%E7%95%8C%E6%9D%AF%E5%BC%80%E5%B9%95&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pc" onsubmit="return checkAccount()" method="post">
                    <div class="loginName">
                        <label for="">Account</label>
                        <input type="text"  name="userName" id="userName">
                        <p class="hideName">你输入的用户名不正确</p>
                    </div>
                    <div class="loginPass">
                        <label for="">
                            Password
                            <span><a href="">Forget Password</a></span>
                        </label>
                        <input type="password" name="password" id="password">
                        <p class="hidePassword">你输入的密码不正确</p>
                    </div>
                    <div class="loginSubmit">
                        <input type="submit" value="Sign In">
                    </div>
                    <div class="joinFree">
                        <a href="">joinFree</a>
                    </div>
                    <div class="loginCheckBox">
                        <input type="checkbox" id="checkbox1" name="checkbox1" checked="false">
                        <label for="checkbox1">I agree to Free Membership Agreement</label>
                    </div>
                    <div class="loginCheckBox">
                        <input type="checkbox" id="checkbox2" name="checkbox2" value="2">
                        <label for="checkbox2" >I agree to Receive marketing materials</label>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/layer.js"></script>
    <script>
    function checkAccount(){
        var userName =$('#userName').val()
        var password =$('#password').val()
        var checkbox1 =$("#checkbox1:checked")
        var checkbox2 =$("#checkbox2").attr('checked')
        console.log(checkbox1)
        alert(checkbox2)
        if(checkbox1 =='on'&&checkbox2=='on'){
        }else{
        if(checkbox1 !='on' ||checkbox2 !='on'){
             layer.tips('请先同意以下协议', '#checkbox1',{tips:3});
            return false
        }
           
        }
        return true
    }
    </script>
</body>
</html>